/*************************************************************************
	> File Name: P1164.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-10 11:27:00
 ************************************************************************/
#include <iostream>
using namespace std;

#define MAX_N 100
#define MAX_M 10000

int dp[MAX_N + 5][MAX_M + 5];
int val[MAX_N + 5];

int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> val[i];
    }
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        dp[i][0] = 1;
        dp[0][i] = 0;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            dp[i][j] = dp[i - 1][j];
            if (j - val[i] >= 0) {
                dp[i][j] += dp[i - 1][j - val[i]];
            }
        }
    } 
    cout << dp[n][m] << endl;
    return 0;
}
